#!/usr/bin/env python
import sys
from model import *
from datetime import datetime

if __name__ == "__main__":
    arg = sys.argv[1:]
    if len(arg) != 1:
        print '''Usage: build_index <collection.xml>'''
    file = arg[0]
    print "Building index..."
    try:
        import psyco
        psyco.full()
    except:
        pass
    index = Index(file)
    print "Index successfully built."